﻿using EWB_library;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApp1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
     
           EWB_MES eWB_MES = new EWB_MES(TET_URL1.Text);
            eWB_MES.sendlabel( equipUniqueCode.Text, workCenterCode.Text,  opCode.Text,  workCellCode.Text,  scanCode.Text);
            ric1.AppendText(eWB_MES.MesSendData);
             ric2.AppendText(eWB_MES.MesReturndata);
            ric3.AppendText(eWB_MES.rMssage);
        
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            EWB_MES eWB_MES = new EWB_MES(TET_URL2.Text);
            string jobid = string.Format("{0}{1}{2}{3}{4}{5}{6}",DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), DateTime.Now.Day.ToString(), DateTime.Now.Hour.ToString(), DateTime.Now.Minute.ToString(), DateTime.Now.Second.ToString(), DateTime.Now.Millisecond.ToString());
            eWB_MES.sendresult(jobid, jobType.Text,scanCode.Text,"NG","1sdasd");
            ric1.AppendText(eWB_MES.MesSendData);
            ric2.AppendText(eWB_MES.MesReturndata);
            ric3.AppendText(eWB_MES.rMssage);
        }
    }
}
